import QtQuick 1.0

Item {
    property int animLong: 0
    property int animShort: 1
    property int animNone: 2

    property int animType
    id: planeContainer
    property alias text: planeWithBanner.text
    width: parent.width
    signal animationDone
    signal disappearDone

    PlaneWithBanner {
        id: planeWithBanner
        height: parent.height
        onAnimationDone: {
            planeContainer.animationDone()
        }

        onDisappearDone: {
            planeContainer.disappearDone()
        }
    }

    Component.onCompleted: {
        if (animType == animLong) {
            planeWithBanner.flyInLong()
        } else if (animType == animShort) {
            planeWithBanner.flyInShort()
        } else {
            planeWithBanner.flyInShort()
            planeWithBanner.completeAnim()
        }
    }

    function complete() {
        planeWithBanner.completeAnim()
    }

    function disappear() {
        planeWithBanner.flyOut()
    }

    function reappear() {
        planeWithBanner.flyInLong()
    }
}
